//
//  UIFunc.h
//  SendGzipData
//
//  Created by URANUS on 15/4/14.
//  Copyright (c) 2015年 URANUS. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "CommFunc.h"

#define NAVIHEIGHT 64 
#define FRAME 1
#define SIZE 2
#define ORIGIN 3
#define INDICATORTAG 999
#define INDICATORSHADOWTAG 998
#define TABHEIGHT 48


//定义RGB结构体, 其中r, g, b分别代表了红色，绿色和蓝色的值
struct ConfigRGB {
    CGFloat r;
    CGFloat g;
    CGFloat b;
};
typedef struct ConfigRGB ConfigRGB;

@interface UIFunc : NSObject

#pragma mark  通过 @“x y w h” 比例字符串进行比较来得到真实frame大小
+ (CGRect) getUIViewFrame:(NSString *)posInfo withSize:(CGSize)size;

#pragma mark  通过 @“x y w h” 比例字符串进行比较来得到真实size大小
+ (CGSize) getUIViewSize:(NSString *)posInfo withSize:(CGSize)size;

#pragma mark  通过 @“x y w h” 比例字符串进行比较来得到真实origin位置
+ (CGPoint) getUIViewOrigin:(NSString *)posInfo withSize:(CGSize)size;

#pragma mark  通过 @“x y w h” 比例字符串进行比较来设置UIView的frame
+ (void) setUIViewFrame:(UIView *)view withPosInfo:(NSString *)posInfo withSize:(CGSize)size;

#pragma mark  通过 @“x y w h” 比例字符串进行比较来设置UIView的size
+ (void) setUIViewSize:(UIView *)view withPosInfo:(NSString *)posInfo withSize:(CGSize)size;

#pragma mark  通过 @“x y w h” 比例字符串进行比较来设置UIView的origin
+ (void) setUIViewOrigin:(UIView *)view withPosInfo:(NSString *)posInfo withSize:(CGSize)size;

#pragma mark  通过 @"255 255 255" 字符串来设置UIButton的RGB值
+ (void) setUIButton:(UIButton *)button withRGB:(NSString *)rgbString;

#pragma mark  通过 @"255 255 255" 字符串来设置UILabel的RGB值
+ (void) setUILabelRGB:(UILabel *)label withRGB:(NSString *)rgbString;

#pragma mark  通过 @"255 255 255" 字符串来设置UITextField的RGB值
+ (void) setUITextField:(UITextField *)textField withRGB:(NSString *)rgbString;

#pragma mark  通过字典以及属性值来设置UIView的位置信息，三种状态分别为FRAME, SIZE 和 ORIGIN
+ (void) setUIView:(UIView *)view dict:(NSDictionary *)dict propertyName:(NSString*)propertyName withPropertyType:(NSInteger) propertyType withSize:(CGSize)size;

#pragma mark  通过字典中得RGB值来设置UIButton的RGB值，RGB在字典中存放的格式为@“255 255 255|255 255 255” 第一组为backgrond的RGB，后一组为文字的RGB
+ (void) setUIButton:(UIButton *)button dict:(NSDictionary *)dict rgbName:(NSString *)rgbName;

#pragma mark  通过字典中得RGB值来设置UILabel的RGB值,GB在字典中存放的格式为@“255 255 255|255 255 255” 第一组为backgrond的RGB，后一组为文字的RGB
+ (void) setUILabel:(UILabel *)label dict:(NSDictionary *)dict rgbName:(NSString *)rgbName;

#pragma mark  通过字典中font大小属性来设置UIButton字体的大小，字典中存放格式为@"12"
+ (void) setUIButtonTitleSize:(UIButton *)button dict:(NSDictionary *)dict propertyName:(NSString *) propertyName;

#pragma mark  通过字典中font大小属性来设置UILabel字体的大小，字典中存放格式为@"12"
+ (void) setUILabelFontSize:(UILabel *)label dict:(NSDictionary *)dict propertyName:(NSString *) propertyName;

#pragma mark  通过字典中所有属性值来设置UIButton，属性包括了frame, 背景的RGB，字体的RGB及字体的大小
+ (void) setUIButtonProperty:(UIButton *)button dict:(NSDictionary *)dict frameName:(NSString *)frameName rgbName:(NSString *)rgbName fontSize:(NSString *)fontSizeName andSize:(CGSize)size;

#pragma mark  通过字典中所有属性值来设置UILabel, 背景的RGB，字体的RGB及字体的大小
+ (void) setUILabelProperty:(UILabel *)label dict:(NSDictionary *)dict frameName:(NSString *)frameName rgbName:(NSString *)rgbName fontSize:(NSString *)fontSizeName andSize:(CGSize)size;

#pragma mark  删除菊花
+ (void) removeUIViewIndicatorView:(UIView *)view;

#pragma mark  添加菊花
+ (void) addUIViewIndicatorView:(UIView *)view;

#pragma mark 通过label的高度设置text的大小, 如果为负数则设置为高度的4/5
+ (void) setLabel:(UILabel *)label titleSize:(CGFloat)size;

#pragma mark 设置button的字体大小按照Button比例
+ (void)setupButton:(UIButton *) button FontSize:(CGFloat) textBili;

#pragma mark 在Config.plist中拿RGB值生成CGColorRef数据
+(CGColorRef) getCGColorForConfig:(NSString *)dictKey ConfigName:(NSString *)dictName Alpha:(int) alpha;

#pragma mark 通过label的高度设置textField的大小, 如果为负数则设置为高度的4/5
+ (void) setTextField:(UITextField *)textField textSize:(float)size;
@end
